import sqlite3
from openpyxl import Workbook
from tkinter import *
def export():
    conn=sqlite3.connect('data.db')
    cr=conn.cursor()
    wb=Workbook()
    ws=wb.active
    cr.execute("SELECT * FROM data")
    result = cr.fetchall()
    for row in result:
        ws.append(row)
    wb.save("d:/log.xlsx")
    conn.close()
app=Tk()
app.geometry("150x50")
btn=Button(text="export",command=export)
btn.pack(padx=10,pady=10)
app.mainloop()